package com.byedu.course.controller;


import com.byedu.course.*;
import com.byedu.domain.course.vo.*;
import com.byedu.domain.course.GuideInforDO;
import com.byedu.domain.course.JobInforDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 发现页面对应接口
 */
@Controller
@RequestMapping("/find")
public class FindController {

    @Autowired
    private CourseService courseService;
    @Autowired
    private AdsService adsService;

    @Autowired
    private GuideInforService guideInforService;

    @Autowired
    private JobInforService jobInforService;

    @Autowired
    private CourseAnalysisService courseAnalysisService;

    /**
     * 获取可用广告的列表
     *
     * @param userId 用户的id
     * @return 可用广告的列表
     */
    @ResponseBody
    @RequestMapping(value = "/getcanuseads", method = {RequestMethod.GET})
    public List<AdsVO> getcanuseads(@RequestParam(value = "userId") String userId) {
        return adsService.listCanUseAds();
    }

    @ResponseBody
    @RequestMapping(value = "/getguides", method = {RequestMethod.GET})
    public List<GuideInforVO> getguides() {

        return guideInforService.getGuideInforLists();
    }

    @ResponseBody
    @RequestMapping(value = "/getjobs", method = {RequestMethod.GET})
    public List<JobInforVO> getjobs() {

        return jobInforService.getJobInforLists();
    }

    @ResponseBody
    @RequestMapping(value = "/getanalysiss", method = {RequestMethod.GET})
    public List<CourseAnalysisVO> getgetanalysiss() {
        System.out.println("--------------------------");
        return courseAnalysisService.getCourseAnalysisLists();
    }

    @ResponseBody
    @RequestMapping(value = "/getJobsCity", method = {RequestMethod.GET})
    public List<String> getJobsCity() {

        return jobInforService.getJobsCity();
    }


    @ResponseBody
    @RequestMapping(value = "/gethotcourse", method = {RequestMethod.GET})
    public List<CourseBuyVO> gethotcourseMap(@RequestParam(value = "userId") String userId) {
        return courseService.listhotCourses();
    }
}
